/**
 * 获取文章请求列表
 */
import request from '@/utils/request'

export const getArticles = params => {
  return request({
    method: 'GET',
    url: '/v1_1/articles',
    params
  })
}
/**
 * 获取文章详情数据
 * @param {*} articleId
 */
export const getArticleDetail = articleId => {
  return request({
    method: 'GET',
    url: '/v1_0/articles/' + articleId
  })
}

/**
 * 收藏文章
 * @param {*} target 文章id
 */
export const addCollected = target => {
  return request({
    method: 'POST',
    url: '/v1_0/article/collections',
    data: {
      target
    }
  })
}

export const deleteCollected = target => {
  return request({
    method: 'DELETE',
    url: '/v1_0/article/collections/' + target
  })
}
